package com.atguigu.f_distinct;

import java.util.stream.Stream;

public class Demo {
    public static void main(String[] args) {
        Stream<Integer> stream = Stream.of(1, 1, 2, 2, 3, 3, 4, 4, 5, 5);


        //去重
        Stream<Integer> distinct = stream.distinct();


        //出工厂 [遍历出厂]
        distinct.forEach(System.out::println);


        //创建引用数据类型流元素的流对象
        Stream<Student> studentStream = Stream.of(new Student("张三", 18),
                new Student("张三", 18));

        Stream<Student> studentStream1 = studentStream.distinct();

        studentStream1.forEach(System.out::println);
    }
}
